# 下载并编译 nginx

SERVER_ROOT_URL=$1
NGINX_PREFIX="nginx-1.20.0"
NGINX="nginx-1.20.0.tar.gz"

ROOT_PATH="/root/.eCloud/"
mkdir ${ROOT_PATH} -p
cd ${ROOT_PATH} || exit

yum install -y openssl openssl-devel
yum install -y zlib zlib-devel
yum install -y pcre pcre-devel
yum install -y make

curl "${SERVER_ROOT_URL}${NGINX}" --output "${NGINX}"
tar xfv "${NGINX_PREFIX}"
cd "${NGINX_PREFIX}" || exit
./configure && make && make install
